package com.kt.mes.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.kt.mes.mapper.ProcessRouteMapper;
import com.kt.mes.domain.ProcessRoute;
import com.kt.mes.service.IProcessRouteService;

/**
 * 工艺路线Service业务层处理
 * 
 * @author lzc
 * @date 2021-01-18
 */
@Service
public class ProcessRouteServiceImpl implements IProcessRouteService 
{
    @Autowired
    private ProcessRouteMapper processRouteMapper;

    /**
     * 查询工艺路线
     * 
     * @param id 工艺路线ID
     * @return 工艺路线
     */
    @Override
    public ProcessRoute selectProcessRouteById(Long id)
    {
        return processRouteMapper.selectProcessRouteById(id);
    }

    /**
     * 查询工艺路线列表
     * 
     * @param processRoute 工艺路线
     * @return 工艺路线
     */
    @Override
    public List<ProcessRoute> selectProcessRouteList(ProcessRoute processRoute)
    {
        return processRouteMapper.selectProcessRouteList(processRoute);
    }

    /**
     * 新增工艺路线
     * 
     * @param processRoute 工艺路线
     * @return 结果
     */
    @Override
    public int insertProcessRoute(ProcessRoute processRoute)
    {
        processRoute.setCreateTime(DateUtils.getNowDate());
        return processRouteMapper.insertProcessRoute(processRoute);
    }

    /**
     * 修改工艺路线
     * 
     * @param processRoute 工艺路线
     * @return 结果
     */
    @Override
    public int updateProcessRoute(ProcessRoute processRoute)
    {
        processRoute.setUpdateTime(DateUtils.getNowDate());
        return processRouteMapper.updateProcessRoute(processRoute);
    }

    /**
     * 批量删除工艺路线
     * 
     * @param ids 需要删除的工艺路线ID
     * @return 结果
     */
    @Override
    public int deleteProcessRouteByIds(Long[] ids)
    {
        return processRouteMapper.deleteProcessRouteByIds(ids);
    }

    /**
     * 删除工艺路线信息
     * 
     * @param id 工艺路线ID
     * @return 结果
     */
    @Override
    public int deleteProcessRouteById(Long id)
    {
        return processRouteMapper.deleteProcessRouteById(id);
    }
}
